package com.gujiangbo.distributedlock;

import java.util.stream.IntStream;

/**
 * @Author: gujiangbo.co
 * @Contact: 646832012@qq.com
 * @Date: 2022/3/18 23:43
 * @Version: 1.0
 * @Description: 模拟多线程高并发场景下调用分布式锁情况
 */
public class DistributedLockClient {

    public static void main(String[] args) {
        Thread[] threads = new Thread[100];
        for (int i = 0; i < threads.length; i++) {
            threads[i] = new Thread(RedisDistributedLock::distributedLockByRedisson);
        }
        for (Thread thread : threads) {
            thread.start();
        }

        //IntStream.range(0, 100).forEach(v -> RedisDistributedLock.distributedLockDoSth());
    }
}
